package com.lwz.laboratory.service;

import com.lwz.laboratory.dao.RecruitplanMapper;
import com.lwz.laboratory.entity.Recruitplan;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class RecruitplanService {
    @Autowired
    private RecruitplanMapper recruitplanMapper;

    public List<Recruitplan> findAllRecruitplan(String planid) {
        return recruitplanMapper.getPlanList(planid);
    }

    public List<Recruitplan> findbyapplicant(String applicant) {
        return recruitplanMapper.selectByapplicant(applicant);
    }



    public List<Recruitplan> findPassRecruitplan() {
        return recruitplanMapper.getPlanpass();
    }

    public Recruitplan findOneRecruitplan(Integer id) {
        return recruitplanMapper.selectByPrimaryKey(id);
    }

    public void Delplan(Integer id) {
         recruitplanMapper.deleteByPrimaryKey(id);
    }

    public void  CheckRecruitplan(Recruitplan recruitplan ){
        recruitplanMapper.updateByPrimaryKeySelective(recruitplan);
    }

    public void AddRecruitplan(Recruitplan recruitplan ){
        recruitplan.setApplicationtime(new Timestamp(System.currentTimeMillis()));
        recruitplanMapper.insertSelective(recruitplan);
    }

    public Recruitplan findOneByplanid(String planid) {
        return recruitplanMapper.selectByplanid(planid);
    }


}
